package com.tencent.wxcloudrun.exception;

public enum CommonErrorEnum implements ErrorCode {
//    SUC(0, "SUCCESS"),
    SUC(0, "操作成功"),
    NET_ERROR(101, "网络异常"),
    INVALID_PARAM(102, "参数异常"),
    HTTP_OK(200, "ok"),
    INTERNAL_ERROR(500, "服务内部错误"),
    NOT_IMPLEMENTED(501, "服务未定义"),

    BAD_REQUEST(400, "Bad Request!"),
    NOT_AUTHORIZATION(401, "NotAuthorization"),
    NOT_FOUND(404, "Not Found"),
    METHOD_NOT_ALLOWED(405, "Method Not Allowed"),
    NOT_ACCEPTABLE(406, "Not Acceptable"),
    UNPROCESSABLE_ENTITY(422, "Unprocessable Entity:{0}"),

    EMOTE_CALL_EXCEPTION(999, "跨服务[{0}]调用异常:{1}"),
    RUNTIMES_EXCEPTION(1000, "[服务器]运行时异常"),
    NULL_VALUE_EXCEPTION(1001, "[服务器]空值异常"),
    DATA_TYPE_CONVERSION_EXCEPTION(1002, "[服务器]数据类型转换异常"),
    IO_EXCEPTION(1003, "[服务器]IO异常"),
    UNKNOWN_METHOD_EXCEPTION(1004, "[服务器]未知方法异常"),
    ARRAY_OUT_OF_BOUNDS_EXCEPTION(1005, "[服务器]数组越界异常"),
    NETWORK_ANOMALY(1006, "[服务器]网络异常"),
    REQUEST_PARAMETER_ERROR(1007, "请求参数错误"),
    SYSTEM_BUSY(1008, "系统繁忙"),
    UNSUPPORTED_ENUM(1009, "不支持的枚举类"),

    DATA_PROCESSING(1400, "数据正在处理，请稍后再试"),
    LOCK_KEY_EMPTY(1401, "分布式锁KEY为空"),
    BUSINESS_ID_EMPTY(1402, "业务ID为空"),

    ERROR_USER_OR_PWD(1300, "用户名或密码异常"),
    ERROR_OLD_PWD(1301, "旧密码错误"),
    USER_NOT_EXIST(1310, "用户不存在"),
    USER_ALREADY_EXIST(1311, "用户已存在"),
    USER_ALREADY_LOGIN(1302, "用户已登录"),


    NO_VERSION(900, "APP异常"),//无系统版本过低
    LOW_VERSION(901, "系统版本过低,请升级版本"),
    DATA_NOT_EXISTS(1800, "数据不存在"),
    DATA_DELETED(1801, "当前数据已删除"),
    USER_NO_AUTH(1900, "当前用户无操作权限"),
    FILE_NOT_EMPTY(1950, "文件不能为空"),
    FILE_OVER_LIMIT_SIZE(1951, "文件大小不能超过10M"),
    FILE_TYPE_ERROR(1952, "文件类型错误,目前支持[{}]等文件类型"),
    FILE_UPLOAD_FAIL(1953, "文件上传失败,请重新上传或联系管理员"),
    FILE_ADDRESS_ERROR(1954, "文件地址异常"),
    FILE_DEL_EXCEPTION(1955, "文件删除异常"),
    DUPLICATE_KEY(2037, "唯一键值重复"),

    GIFT_NOT_EXIST(2100, "礼物不存在"),
    GIFT_NUM_LACK(2101, "礼物数量不足"),
    STROE_ALREADY_EXIST(2201, "小店已存在,最多只能创建一个小店"),

    PAY_SIGN_FAIL(2100, "支付验签失败"),
    PAY_FAIL(2101, "支付失败"),
    PAY_REFUND_FAIL(2102, "({})支付退款失败"),
    PAY_ERROR_BALANCE(2190, "余额不足"),
    ID_CARD_ERROR(3050, "身份证格式异常"),
        ;

    private final int ec;
    private final String em;

    private CommonErrorEnum(int ec, String em) {
        this.ec = ec;
        this.em = em;
    }

    public int getEc() {
        return this.ec;
    }

    public String getEm() {
        return this.em;
    }
}